package lyn;

import java.util.concurrent.Callable;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lyn
 * Date: 2025-01-20
 * Time: 14:04
 */
class Shape{
    public void draw(){
        System.out.println("画图形！");
    }
}
class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
class Cycle extends Shape{
    @Override
    public void draw() {
        System.out.println("圆");
    }
}
class Flower extends Shape{
    @Override
    public void draw() {
        System.out.println("❀");
    }
}
class Triangle extends Shape{
    @Override
    public void draw() {
        System.out.println("三角");
    }
}
public class text1 {
    public static void main(String[] args) {
        Rect rect = new Rect();
        Cycle cycle = new Cycle();
        Flower flower = new Flower();
        Shape[] shapes = {rect,cycle,flower,rect,cycle};
        for (Shape shape: shapes) {
            shape.draw();
        }
    }
}
